<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<div class="center_right" id="MemberCenterCtrl" style="display: block;">
<div class="order_namelist">
<span <c:if test="${type==null}">class="active"</c:if>><a href="sss-1.do" class="red">所有订单</a></span>
<span <c:if test="${type=='1'}">class="active"</c:if>><a href="sss-1.do?type=1" class="red">待支付订单</a></span>
<span <c:if test="${type=='2'}">class="active"</c:if>><a href="sss-1.do?type=2" class="red">待发货订单</a></span>
<span <c:if test="${type=='3'}">class="active"</c:if>><a href="sss-1.do?type=3" class="red">待确认订单</a></span>
<span <c:if test="${type=='4'}">class="active"</c:if>><a href="sss-1.do?type=4" class="red">待评价订单</a></span>
</div>
	
<form action="" method="post" name="delform">
        
	  <div class="good-canshu" style="z-index:11"><span class="good-name">商品名称</span><span class="good-price">售价</span><span class="good-num">数量</span> <span class="good-action">商品操作</span><span class="good-total">总金额(元)</span>
	  <span class="good-status">交易状态</span> <span class="deal-action">交易操作</span></div>
		<c:forEach items="${orderlist.list}" var="ordrList">
          <div class="single" onmouseover="this.className='singlehover'" onmouseout="this.className='single'">
		 <div class="order-detail">订单号：<span>${ordrList.shopOrderId}</span>&nbsp;&nbsp;&nbsp;下单时间：<span>${ordrList.shopOrderItemCreatTime }</span></div>
         <!-- 列表详情区域开始 -->  
		  <div class="goodlist-wrap">   
		<!-- 左边商品区域开始 -->  
		  <div class="three-area">
		  <!-- 订单商品循环go -->
			  <div class="cos">
			   <span class="c1"><a href="shopgoods-1.do?productId=${ordrList.shopOrderItemProductId }" class="dl"> <img src="${ordrList.productImgs}" width="70" height="70" /></a>
			  <span class="dd">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="shopgoods-1.do?productId=${ordrList.shopOrderItemProductId }" class="dd">${ordrList.shopOrderItemProductName}</a></span>
			 <span class="dd"></span>
			  </span>
			  <span class="c2">${ordrList.shopOrderItemProductPrice}</span>
			  <span class="c2">${ordrList.shopOrderItemNum}</span>
			    <span class="c2">  无</span>
			  </div>
		  <!-- 订单商品循环end --> 
		  </div>
		  <!-- 左边商品结束 -->  
		 
  <div class="total-area"><p>${ordrList.shopOrderItemTotalPrice}</p><p>(在线支付)</p>
		    </div>
		     <div class="deal-area">
			<p class="red"> 
			 <c:if test="${ordrList.shopOrderItemState==1}">
			 <p>待支付</p>
			 </c:if>
			 <c:if test="${ordrList.shopOrderItemState==2}">
			 <p>待发货</p>
			 </c:if>
			 <c:if test="${ordrList.shopOrderItemState==3}">
			 <p>待确认</p>
			 </c:if>
			 <c:if test="${ordrList.shopOrderItemState==4}">
			 <p>已完成交易</p>
			 </c:if>
			 <c:if test="${ordrList.shopOrderItemState==5}">
			 <p>已完成交易</p>
			 </c:if>
			  </p>
			  </div>
			   <div class="act-area"> 
			   <c:if test="${ordrList.shopOrderItemState==1}">
			  <p><a href="javascript:vod(0)" onclick="cancelOrder(${ordrList.shopOrderItemId});return false;" >取消订单</a> </p>		
			  <p><a class="confirm" href="oreder-tijiao.do?orderId=${ordrList.shopOrderItemId}">前去支付</a> </p>
			  </c:if>	
			  <c:if test="${ordrList.shopOrderItemState==3}">
			  	<p><a class="confirm" href="javascript:vod(0)" onclick="queren(${ordrList.shopOrderItemId},${ordrList.shopOrderItemState});return false;">确定收货</a> </p>
			  </c:if>
			  <c:if test="${ordrList.shopOrderItemState==4}">
			  	<p><a class="confirm" href="javascript:vod(0)" onclick="fuzhi('${ordrList.shopOrderItemProductName}','${ordrList.shopOrderItemProductId}','${ordrList.shopOrderItemId}','${ordrList.shopOrderItemState}');return false;">去评价</a> </p>
			  </c:if>
		    </div> 
		  </div>
       <!-- 列表详情区域结束 -->
	   </div>
	   </c:forEach>
	   
<div id="stylized" class="myform" style="display:none;z-index:100;">
    <form id="form" name="form" method="post" action="shop-add-pinlun.do">
        <h1 id="dsd">商品评论</h1>
        <p class="p"></p><input type="hidden" id="dindanId" name="dindanId" value=""/><!-- 订单号 -->
        <input type="hidden" id="pf" name="pf" value="3"/><!--评分-->
        <input type="hidden" id="px" name="px" value=""/>
        <input type="hidden" id="zt" name="zt" value=""/>
       <label class="la">好评
           <input class="pj" type="radio" name="pj"  checked="checked" value="3"/>
       </label>

       <label class="la">中评
            <input class="pj" type="radio" name="pj" id="d1"  value="2"/>
       </label>
       
       <label class="la">差评
            <input class="pj" type="radio" name="pj" value="1"/>
       </label>

	<textarea name="liuyan" id="ss" rows="4" cols="60" placeholder="宝贝满足您的期待吗？说说您的使用心得，分享给想买的他们吧"></textarea><!--评论-->
       
       <div class="spacer">
       <div style="float: left;margin-left:30px;margin-right: 80px;margin-top: 20px;">
       <a class="btn_submit_pay" href="javascript:void(0)" onclick="tjbd();return false;">发表评论</a>
       </div>
       <div style="float: left;margin-top: 20px;">
       <a class="btn_submit_pay" id="qx" onclick="fresh();return false;" href="javascript:vod(0);">暂不评论</a>
       </div>
       </div>

    </form>
</div>
	   
	   <!-- 订单循环结束 -->
	   	</form>
	   	<script type="text/javascript">

		function tjbd(){
			var productId =$("#dindanId").val();
			var cart = $("input[name='pj']:checked").val();//评分
			var pinlun=$("#ss").val();
			var px =$("#px").val();
		 	var zt =$("#zt").val();
			$.ajax({
				type:'post', //传送的方式,get/post
				url:'shop-add-pinlun.do', //发送数据的地址
				 data:{
					 productId:productId,pf:cart,pinlun:pinlun,px:px,state:zt
				 },
				 dataType: "json",
				 success : function(data) {
					 location.reload();
					}
				});
			}
	   	
	   	//取消订单
	   	function cancelOrder(i){
	   		if(window.confirm('你确定要删除吗？')){
	   			$.ajax({
					type:'post', //传送的方式,get/post
					url:'shop-order-delect.do', //发送数据的地址
					 data:{
						 orederID:i
					 },
					 dataType: "json",
					});
	   			fresh();
		   		}else{
					return false;
			   		}
		}

	   	function showBgs() { 
		    $("#stylized").css({
		        display:"block"
		    });
		    $(".Dialog-make").css({
		        display:"block"
		    });
		}
	   	
	   	//确认收货
	   	function queren(i,m){
	   			$.ajax({
					type:'post', //传送的方式,get/post
					url:'update-order-state.do', //发送数据的地址
					 data:{
						 state:m,orderId:i
					 },
					 dataType: "json",
					});
	   			showBg();
		}

		function fuzhi(i,m,q,z){
			showBgs();
		 	$(".p").html(i);
		 	$("#dindanId").val(m);
		 	$("#px").val(q);
		 	$("#zt").val(z);
			}
	   	

	   	//刷新当前页面
		function fresh(){
			location.reload();
			}

		function showBg() { 
		    $("#showIncludeCart").css({
		        display:"block"
		    });
		    $(".Dialog-make").css({
		        display:"block"
		    });
		}
	   	</script>
	   	<style>
			.layui-layer-btn .layui-layer-btn0 {
			    border-color: #f60;
			    background-color: #f40;
			    color: #fff;
			}
			.Dialog-make{width:100%;height:100%;filter:alpha(opacity=10);opacity:0.1;position:absolute;top:0;left:0;z-index:98;background:#C0C0C0}
            .Dialog-make iframe{width:100%;height:100%;filter:alpha(opacity=0);opacity:0;border:0px;}
            #dsd{border:0; margin:0; padding:0;color:#FF7F50;}
            .spacer{clear:both; height:1px;}
  			.myform{margin:0 auto;width:500px;padding:14px;}
  			#stylized{border:solid 2px #FF7F50;background:#F5F5F5;margin-top:0px;position: absolute;top:275px;left:500px;}
  			#stylized #dsd{font-size:16px;font-weight:bold;margin-bottom:8px;}
  			#stylized .p{font-size:12px;color:#FF7F50; margin-bottom:20px;border-bottom:solid 1px #FF7F50;padding-bottom:10px;}
  			#stylized .la{display:block;font-weight:bold;text-align:right; width:140px;float:left;color:#FF7F50;}
  			#stylized .small{color:#FF7F50;display:block;font-size:11px;font-weight:normal;text-align:right;width:140px;}
  			#stylized .pj{float:left;font-size:15px;padding:4px 2px;border:solid 1px #FF7F50;width:200px; margin:2px 0 20px 10px;}
  			 #ss{margin-left: 10px;}
  			.red{color:##FF7F50;}
  			.blue{color:#FF7F50;}
		</style>
   <!-- 分页 --> 
        <c:if test="${not empty orderlist }">
       <div class="page"> 
        <div> 
        	
        	<a class="prev" href="sss-${orderlist.firstPage}.do?type=${type }">«</a>
        	
        	<c:forEach items="${orderlist.navigatepageNums }" var="i">
        		<c:if test="${i==orderlist.pageNum }">
        			<span class="current">${i}</span>
        		</c:if>
        		<c:if test="${i!=orderlist.pageNum}">
        			<a class="num" href="sss-${i}.do?type=${type}">${i}</a>
        		</c:if>
        	</c:forEach>
        		
        	<a class="next" href="sss-${orderlist.lastPage}.do?type=${type }">»</a>
         	
         	<span class="rows">共${orderlist.total } 个订单</span>
        </div>
       </div>
       </c:if>


<div class="Dialog-make" style="display:none;"></div>


        <div class="addcart_box" style="z-index:99;margin-left: 400px;width: 500px;position: absolute;top:250px;left:200px;">
         <div id="showIncludeCart" style="display:none;width: 250px;"> 
           <a class="buy_pop_close" onclick="fresh();return false;" title="关闭"></a> 
           <div class="buy_pop_top">
            <div class="title">
                     确认收货成功
            </div> 
            <div class="btn_continue"> 
             <div class="btn_cart">
              <a onclick="fresh();return false;" href="javascript:vod(0);">确定</a>
             </div> 
            </div> 
           </div> 
          </div> 
         </div>
         
         
